<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
<ui:define name="head">
    <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
    <script type="text/javascript" language="javascript">
        document.onkeydown = function TabReplace() {
            if (event.keyCode == 13) {
                if (event.srcElement.tagName != 'BUTTON')
                    event.keyCode = 9;
                else
                    event.srcElement.click();
            }
        }
    </script>
    <style type="text/css">
        .c_c {
            background: gray;
        }

        .p_c {
            background: green;
        }
    </style>
</ui:define>
<ui:define name="content">
<div style="margin:5px;">
<h:form id="form">
<p:growl id="msgs" showDetail="false"/>
<p:panel id="inputItemHieRelap"
         header="#{esCommonAction.itemTypeListValueOfAlias(itemHieRelapTkcttAction.itemOfEsItemHieRelap.belongToType)}"
         style="width: 100%">
    <h:panelGrid columns="2" style="width: 100%">
        <h:panelGrid id="pgItemHieRelapInput" widgetVar="wvItemHieRelap"
                     columns="8" style="width: 100%">

            <h:outputLabel for="noItemHieRelap" value="编号:"/>
            <h:inputText id="noItemHieRelap"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.strNo}"
                         style="font-weight:bold;;background-color:gainsboro;"
                         disabled="true">
            </h:inputText>

            <h:outputLabel for="name" value="名称:"/>
            <h:inputText id="name" value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.name}"
                         style="font-weight:bold;;background-color:gainsboro;"
                         disabled="true"/>

            <h:outputLabel for="note" value="备注内容:"/>
            <h:inputTextarea id="note" value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.note}"
                             style="font-weight:bold;;background-color:gainsboro;"
                             rows="1" autoResize="false"
                             disabled="true"/>

            <h:outputLabel for="unitItemInfo" value="单位:"/>
            <h:inputText id="unitItemInfo" value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.unit}"
                         style="font-weight:bold;;background-color:gainsboro;"
                         disabled="true"/>

            <h:outputLabel for="contractUnitPriceItemInfo" value="合同单价:"/>
            <h:inputText id="contractUnitPriceItemInfo"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.contractUnitPrice}"
                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left"
                         disabled="true">
                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
            </h:inputText>

            <h:outputLabel for="contractQuantityItemInfo" value="合同数量:"/>
            <h:inputText id="contractQuantityItemInfo"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.contractQuantity}"
                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left"
                         disabled="true">
                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
            </h:inputText>

            <h:outputLabel for="contractAmountItemInfo" value="合同金额:"/>
            <h:inputText id="contractAmountItemInfo"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.contractAmount}"
                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left"
                         disabled="true">
                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
            </h:inputText>

            <h:outputLabel for="signPartAPriceItemInfo" value="其中：甲供材单价:"
                           rendered="#{itemHieRelapTkcttAction.strSignPartAPriceRendered}"/>
            <h:inputText id="signPartAPriceItemInfo"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.signPartAPrice}"
                         style="font-weight:bold;text-align:right;background-color:gainsboro;"
                         rendered="#{itemHieRelapTkcttAction.strSignPartAPriceRendered}"
                         disabled="true"/>

            <h:outputLabel for="deletedFlagItemInfo" value="记录删除标志:"/>
            <h:inputText id="deletedFlagItemInfo"
                         value="#{esPowerAction.getLableByValueInDeleteFlagList(
                                                         itemHieRelapTkcttAction.itemOfEsItemHieRelap.deletedFlag)}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="originFlagItemInfo" value="数据来源的标志:"/>
            <h:inputText id="originFlagItemInfo"
                         value="#{esCommonAction.originFlagListValueOfAlias(
                                                         itemHieRelapTkcttAction.itemOfEsItemHieRelap.originFlag)}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="createdByItemInfo" value="记录创建人:"/>
            <h:inputText id="createdByItemInfo" value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.createdBy}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="createdDateItemInfo" value="记录创建时间:"/>
            <h:inputText id="createdDateItemInfo" value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.createdDate}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="lastUpdByItemInfo" value="记录最近修改人:"/>
            <h:inputText id="lastUpdByItemInfo" value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.lastUpdBy}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="lastUpdDateItemInfo" value="记录最近修改时间:"/>
            <h:inputText id="lastUpdDateItemInfo" value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.lastUpdDate}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="modificationNumItemInfo" value="记录修改次数:"/>
            <h:inputText id="modificationNumItemInfo"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.modificationNum}"
                         style="font-weight:bold;float:left;background-color:gainsboro"
                         disabled="true">
                <f:convertNumber type="number" pattern="#,###,###,###,##0"/>
            </h:inputText>

        </h:panelGrid>

        <h:panelGrid id="pgInputBlur" columns="8" rendered="false">
            <h:outputLabel for="pkidItemHieRelap" value="Pkid:"/>
            <h:inputTextarea id="pkidItemHieRelap"
                             value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.pkid}"
                             style="font-weight:bold;width:200px"
                             disabled="true"/>
            <h:outputLabel for="parentPkidItemHieRelap" value="父层Pkid:"/>
            <h:inputTextarea id="parentPkidItemHieRelap"
                             value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.parentPkid}"
                             style="font-weight:bold;width:200px"
                             disabled="true"/>
            <h:outputLabel for="itemPkidItemHieRelap" value="项Pkid:"/>
            <h:inputTextarea id="itemPkidItemHieRelap"
                             value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.itemPkid}"
                             style="font-weight:bold;width:200px"
                             disabled="true"/>
            <h:outputLabel for="correspondingPkidItemHieRelap" value="对应Pkid:"/>
            <h:inputTextarea id="correspondingPkidItemHieRelap"
                             value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.correspondingPkid}"
                             style="font-weight:bold;width:200px"
                             disabled="true"/>
            <h:outputLabel for="gradeItemHieRelap" value="层号:"/>
            <h:inputText id="gradeItemHieRelap"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.grade}"
                         style="font-weight:bold"
                         disabled="true"/>
            <h:outputLabel for="orderidItemHieRelap" value="序号:"/>
            <h:inputText id="orderidItemHieRelap"
                         value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelap.orderid}"
                         style="font-weight:bold"
                         disabled="true"/>
        </h:panelGrid>
    </h:panelGrid>
</p:panel>

<p:ajaxStatus style="width:16px;height:16px;">
    <f:facet name="start">
        <h:graphicImage value="/images/ajaxloading.gif"/>
    </f:facet>
    <f:facet name="complete">
        <h:outputText value=""/>
    </f:facet>
</p:ajaxStatus>

<p:dataTable id="ptt" style="width:100%;"
             value="#{itemHieRelapTkcttAction.itemOfEsItemHieRelapList}"
             var="record"
             rowKey="#{record.pkid}"
             selection="#{itemHieRelapTkcttAction.itemOfEsItemHieRelapSelected}"
             selectionMode="single"
             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
			                        {LastPageLink} {RowsPerPageDropdown}"
             paginator="true"
             paginatorPosition="bottom"
             rows="100"
             rowsPerPageTemplate="200,100,50,40,30,20,10"
             rowIndexVar="row"
             emptyMessage="数据记录为空..."
             widgetVar="dtItemDetail"
             rowStyleClass="#{record.name eq '合计'? 'c_c': record.name eq '总合计'? 'c_c':null}"
             stickyHeader="#{itemHieRelapTkcttAction.strStickyHeaderFlag}">
    <p:ajax event="rowSelect" listener="#{itemHieRelapTkcttAction.onRowSelect}" update=":form:inputItemHieRelap"/>

    <p:column style="width:20px" headerText="序号">
        <h:outputText value="#{row + 1}"/>
    </p:column>

    <p:column style="width:120px" headerText="编号">
        <h:outputText value="#{record.strNo}" escape="false"/>
    </p:column>

    <p:column style="width:200px" headerText="名称">
        <h:outputText value="#{record.name}"/>
    </p:column>

    <p:column style="width:30px" headerText="单位">
        <h:outputText value="#{record.unit}" style="text-align:right"/>
    </p:column>

    <p:column style="width:80px" headerText="合同单价">
        <h:outputText value="#{record.contractUnitPrice}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column style="width:80px" headerText="合同数量">
        <h:outputText value="#{record.contractQuantity}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column style="width:80px" headerText="合同金额">
        <h:outputText value="#{record.contractAmount}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column style="width:300px" headerText="备注">
        <h:outputText value="#{record.note}"/>
    </p:column>

</p:dataTable>
</h:form>
</div>
</ui:define>
</ui:composition>